﻿@model AVTracker.Models.LoginModel
@{
    ViewBag.Title = "Tracker";
}
@functions{
    public string GetAntiForgeryToken()
    {
        string cookieToken, formToken;
        AntiForgery.GetTokens(null, out cookieToken, out formToken);
        return cookieToken + ":" + formToken;
    }
}

<header>
    <h1>@ViewBag.Title</h1>
</header>

<div id="main-content">
    <input id="antiForgeryToken" type="hidden" value="@GetAntiForgeryToken()" />
    <p class="error" data-bind="text: error"></p>
    <div id="select-vehicle">
        <label>Vehicle No : </label>
        <select id="vehicle-list" data-bind="options: todoLists, optionsText: 'VehicleId', value: selectedVehicle, optionsCaption: 'Select Vehicle'"></select>
        <button id="btntrack" data-bind="click: findVehicleLocation, enable: false">Track Now</button>
        <label class="label-refresh">Refresh data by : </label>
        <select id="refresh-time" data-bind="options: refreshTimeIntervals, value: selectedInterval"></select>
    </div>
    <div id="map-canvas"></div>

    @*<section id="lists" data-bind="foreach: todoLists, visible: todoLists().length > 0">
        <article class="todoList">
            <header>
                <form data-bind="validate: true">
                    <input class="required" data-bind="value: title, selected: isEditingListTitle, blurOnEnter: true" />
                </form>
            </header>

            <a href="#" class="deletelist" data-bind="click: $parent.deleteTodoList">X</a>

            <ul data-bind="foreach: todos">
                <li>
                    <input type="checkbox" data-bind="checked: isDone" />
                    <input class="todoItemInput" type="text" data-bind="value: title, disable: isDone, blurOnEnter: true" />
                    <a href="#" data-bind="click: $parent.deleteTodo">X</a>
                    <p class="error" data-bind="visible: errorMessage, text: errorMessage"></p>
                </li>
            </ul>

            <form data-bind="submit: addTodo">
                <input class="addTodo" type="text" data-bind="value: newTodoTitle, placeholder: 'Type here to add', blurOnEnter: true, event: { blur: addTodo }" />
            </form>

            <p class="error" data-bind="visible: errorMessage, text: errorMessage"></p>
        </article>
    </section>*@
</div>

@*@if (@User.Identity.IsAuthenticated)
{*@
@section scripts {
    @Scripts.Render("~/bundles/knockout")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/todo")
}
@*}*@